Skip to content

[GEN][ZH] Make aircraft takeoff order deterministic #1297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Caball009
Copy link

@Caball009 Caball009 commented Jul 17, 2025

The order in which aircraft take off from airfields is non-deterministic, which can cause delays between pairs of aircraft taking off. This PR defers an airfield runway reservation request once, if that request came from a 'lower priority' space.

TODO

  • Replicate in Generals
  • Add code comments

@Caball009 Caball009 added China Affects China faction Enhancement Is new feature or request Minor Severity: Minor < Major < Critical < Blocker USA Affects USA faction Gen Relates to Generals ZH Relates to Zero Hour NoRetail This fix or change is not applicable with Retail game compatibility labels Jul 17, 2025
@Caball009
Copy link
Author

Caball009 commented Jul 31, 2025

@xezon I made a small adjustment to the code to make it a bit more flexible. Airfields with equal counts of spaces and runways are excluded. Index checks are now tied to the runway count so that it can now handle this 3 runway / 6 space airfield: https://www.moddb.com/mods/operation-firestorm/images/usa-airforce-generals-airfield

If there are airfields with say 2 runways and more than 4 spaces (i.e. more than double the runway count), the fix in this PR will not work 100%. I'm not sure how to fix that yet or if such airfields even exist.

Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this and it works in principle but there is one bug.

A bit of documentation for the new logic would be good.

@Caball009
Copy link
Author

I can replicate this in Generals if there are no other issues.

Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logically makes sense. If it works without bugs, then it is good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
China Affects China faction Enhancement Is new feature or request Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker NoRetail This fix or change is not applicable with Retail game compatibility USA Affects USA faction ZH Relates to Zero Hour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The order in which aircraft take off from airfields is non-deterministic
2 participants